<!--<?php
print <<<EOT
--><link rel="stylesheet" type="text/css" href="$imgpath/post/post.css?20101231" media="all" />
<!--
EOT;
if((!$db_toolbar || $_COOKIE['toolbarhide']) && $pwForumList){print <<<EOT
-->
<div id="menu_forumlist" style="display:none;">
	<div class="sbar-box-a" style="width:700px;">
		<div class="sbar-title" style="cursor:pointer" onclick="try{pw_bottom.hiddenTab();read.close();}catch(e){read.close();}">
				<span class="adel">隐藏</span>
				<span id="title_forumlist" class="b">快速跳转</span>
		</div>
		<div class="sbar-box-b">
			<div class="forum-list-popout">
<!--
EOT;
foreach($pwForumList as $key=>$value){print <<<EOT
-->
			<dl class="cc">
				<dt><a href="index.php?cateid=$key">$value[name]</a></dt>
				<dd class="cc">
<!--
EOT;
foreach($value['child'] as $k=>$v){print <<<EOT
-->
					<a href="thread.php?fid=$k" onclick="return pwForumList(true,gIsPost,$k);"><span>$v</span></a>
<!--
EOT;
}print <<<EOT
-->
				</dd>
			</dl>
<!--
EOT;
}print <<<EOT
-->
			</div>
		</div>
	</div>
</div>
<!--
EOT;
}print <<<EOT
-->
<div id="breadCrumb">$msg_guide<!--
EOT;
if($action == 'modify'){print <<<EOT
-->
<em>&gt;</em>编辑帖子
<!--
EOT;
}elseif($action == 'reply'){print <<<EOT
-->
<em>&gt;</em>发表回复
<!--
EOT;
}else{print <<<EOT
-->
<em>&gt;</em>发表帖子
<!--
EOT;
}print <<<EOT
-->
</div>
<!--
EOT;
if($action=='modify' && ($winduid == $atcdb['authorid'] && $_G['allowdelatc'] || $isGM || pwRights($isBM,'modother'))){print <<<EOT
-->
<form method="post" name="delForm" action="post.php?fid=$fid">
<div class="t"><table cellpadding="0" cellspacing="0" width="100%">
	<tr><td class="h"><b>修改文章</b></td></tr>
	<tr class="tr3 f_one"><th style="padding:10px;"><span class="fr"><span class="b">注意:</span> 如果这个帖子是主题内的第一个帖子且已有人回复此帖，需拥有管理权限才能删除。</span><span class="s1">删除帖子</span>(此操作不可恢复，请慎重使用！)</th></tr>
	<tr class="tr3 f_two"><th style="padding:5px 10px;">
	<div class="fr">
<!--
EOT;
if(($db_gdcheck & 4) && (!$db_postgd || $winddb['postnum'] < $db_postgd)){
$gdSize = explode("\t",$db_gdsize);
print <<<EOT
-->
		<input class="input fl mr5" type="text" name="gdcode" size="5" onfocus="showgd('ckcode_modify');" />
		<div id="ckcode_modify" class="fl mr5" style="display:none">
<script type="text/javascript" src="js/pw_authcode.js"></script>
<script>
var tip = '看不清楚，换一张';
var flashWidth = "$gdSize[0]";
var flashHeight = "$gdSize[1]";
var gdtype = $db_gdtype;
showGdCode();
</script>
</div><span class="fl mr20" onclick="this.previousSibling.focus();">点此显示验证码</span>
<!--
EOT;
}
if(($db_ckquestion & 4) && (!$postq || $winddb['postnum'] < $postq) && $db_question){
$qkey = array_rand($db_question);
if($db_imagequestion){
	$question = '<img id="ckquestion" src="ckquestion.php?q='.$qkey.'&t='.$timestamp.'" align="top">';
}else{
	$question = $qkey<0 ? getMachineQuestion_1() :  $db_question[$qkey];
}
$q_a = $question.($showq && $qkey>0?" 正确答案:".$db_answer[$qkey] : '');
print <<<EOT
-->
		<span class="fl mr5">验证问题:</span><span class="fl mr5">$q_a</span>
		<input class="input" type="text" name="qanswer" size="5"/>
		<input type="hidden" name="qkey" value="$qkey" />
<!--
EOT;
}print <<<EOT
-->
		<span class="bt2" onclick="cancleUnload();"><span><button type="submit">直接删除</button></span></span>
		</div>
		</th>
	</tr>
</table></div>
<input type="hidden" value="1" name="step" />
<input type="hidden" value="$action" name="action" />
<input type="hidden" value="$fid" name="fid" />
<input type="hidden" value="$tid" name="tid" />
<input type="hidden" value="$pid" name="pid" />
<input type="hidden" value="$article" name="article" />
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" value="cn0zz" name="_hexie" />
</form>
<script language="javascript">
function cancleUnload() {
	window.onbeforeunload = function(){}
}
</script>
<script type="text/javascript">
<!--
EOT;
$tmpVerify = GetVerify($onlineip.$GLOBALS['winddb']['regdate'].$fid.$tid);print <<<EOT
-->
if (document.delForm) document.delForm._hexie.value='$tmpVerify';
</script>
<!--
EOT;
}print <<<EOT
-->
<div id="pw_content" class="mb10">
<form method="post" id="mainForm" name="FORM" action="post.php?fid=$fid" enctype = "multipart/form-data" onsubmit="return checkpost(document.FORM);">
<input type="hidden" value="$magicname" name="magicname"/>
<input type="hidden" value="$magicid" name="magicid"/>
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="cyid" value="$cyid" />
<input type="hidden" name="ajax" value="1" />
<input type="hidden" name="iscontinue" value="0" />
<script type="text/javascript">
var stylepath = '$stylepath';
var $=function(s){return document.getElementById(s)};
function post_set() {
	var ishide = $('post_set_button').className == 'post_more' ? 1 : 0;
	$('post_set_button').className = ishide ? 'post_more post_upmore' : 'post_more';
	$('post_set_box').style.display = ishide ? '' : 'none';
	SetCookie('post_set',ishide);
	event && (event.returnValue = false);
}
</script>
<div class="t" style="min-width:778px;background:#ffffff;">
<table cellPadding="0" cellSpacing="0" width="100%" style="table-layout:fixed;">
	<tr class="hB">
		<td class="pd15"><b class="f14 b mr10">
<!--
EOT;
if($action == 'modify'){print <<<EOT
-->
编辑帖子
<!--
EOT;
}elseif($action == 'reply'){print <<<EOT
-->
发表回复
<!--
EOT;
}else{print <<<EOT
-->
发表帖子
<!--
EOT;
}print <<<EOT
-->
		</b><span class="bt2" style="margin:0;"><span><button type="submit" name="quickpost">发布</button></span></span>
		<span class="bt2" style="margin:0;"><span><button type="button" onclick="gopreview();">预览</button></span></span>
		</td>
		<td><div class="pd15"><a href="profile.php?action=permission&fid=$fid" title="查看您在本版块的权限" target="_blank" class="fr">版块权限查看</a></div></td>
	</tr>
	<tr class="vt">
		<td style="padding:0 15px;" colspan="2">
          <div class="cc mb5" style="padding-top:15px;">
<!--
EOT;
if ($article == '0' && (($t_per>0 || $pwpost->admincheck) && $t_db && !$theSpecialFlag)) {print <<<EOT
-->
                <div class="menu_select" id="td_p_type">
                    <div id="p_type_v" onclick="showPtypeSelect();">分类</div>
                    <ul id="menu_p_type" style="max-height:300px;overflow:hidden;overflow-y:auto;">
<!--
EOT;
if (!$db_forcetype) {
print <<<EOT
-->
                        <li onclick="selectPtype(0)">无</li>
<!--
EOT;
}
print <<<EOT
-->
<!--
EOT;
foreach ($t_db as $key => $value) {
if ($value['upid'] == 0) {print <<<EOT
-->
                        <li onclick="selectPtype('$key')">$value[name]</li>
<!--
EOT;
}}print <<<EOT
-->
                    </ul>
                </div>
                <div class="menu_select" id="td_p_sub_type" style="display:none">
                    <div id="p_sub_type_v" onclick="showPsubtypeSelect();">分类</div>
                    <ul id="menu_p_sub_type" style="max-height:300px;overflow:hidden;overflow-y:auto;width:auto;"></ul>
                </div>
<input type="hidden" name="p_type" value="" /><input type="hidden" name="p_sub_type" value="" />
<script language="JavaScript">
(function() {
var t_db = JSONParse('$tdbJson');
var t1,t2 = null;
var isforce = '$db_forcetype';
$('menu_p_type').onmouseout = function() {t1 = setTimeout(closePtypeSelect,100);}
$('menu_p_type').onmouseover = function() {clearTimeout(t1);}
$('menu_p_sub_type').onmouseout = function() {t2 = setTimeout(closePsubtypeSelect,100);}
$('menu_p_sub_type').onmouseover = function() {clearTimeout(t2);}
showPtypeSelect = function() {
	var ulDefaultWidth=$('menu_p_type').offsetWidth-2;
	delPtypeSelectLi();
    if ($('menu_p_type').className != 'hover') {
			$('p_type_v').style.width = $('menu_p_type').offsetWidth - 27 + 'px';
			$('menu_p_type').style.width=ulDefaultWidth+'px';
        $('menu_p_type').className = 'hover';
    } else {
        closePtypeSelect();
    }
}
showPsubtypeSelect = function() {
	var ulsubDefaultWidth=$('menu_p_sub_type').offsetWidth-2;
	delPsubtypeSelectLi();
    if ($('menu_p_sub_type').className != 'hover') {
        $('p_sub_type_v').style.width = $('menu_p_sub_type').offsetWidth - 27 + 'px';
		$('menu_p_sub_type').style.width =ulsubDefaultWidth+'px';
        $('menu_p_sub_type').className = 'hover';
    } else {
        closePsubtypeSelect();
    }
}
var delPtypeSelectLi = function(){
	var list = $('menu_p_type').children;
	var selectText = $('p_type_v').innerHTML;
	for(var i =0;i<list.length;i++){
		if(list[i].innerHTML == selectText){
			list[i].style.display = 'none';
		}else{
			list[i].style.display = '';
		}
	}
}
var delPsubtypeSelectLi = function(){
	var list = $('menu_p_sub_type').children;
	var selectText = $('p_sub_type_v').innerHTML;
	for(var i =0;i<list.length;i++){
		if(list[i].innerHTML == selectText){
			list[i].style.display = 'none';
		}else{
			list[i].style.display = '';
		}
	}
}
closePtypeSelect = function() {
    $('menu_p_type').className = '';
    var v = document.FORM.p_type.value;
    $('p_type_v').innerHTML = typeof t_db[v] == 'undefined' ? '无' : t_db[v]['name'];
}
closePsubtypeSelect = function() {
    $('menu_p_sub_type').className = '';
    var v = document.FORM.p_sub_type.value;
	$('p_sub_type_v').innerHTML = typeof t_db[v] == 'undefined' ? '无' : t_db[v]['name'];
}
selectPtype = function(v) {

    if (typeof t_db[v] == 'undefined') {
        document.FORM.p_type.value = 0;
    } else {
        document.FORM.p_type.value = v;
        if (typeof t_db[v]['sub'] != 'undefined') {
            $('td_p_sub_type').style.display = '';
            var sub = t_db[v]['sub'];
            var html = '';
            if (isforce == 0) {
            	html = '<li onclick="selectPsubtype(0)">无</li>';
            }
            for (var i = 0; i < sub.length; i++) {
                html += "<li onclick=\"selectPsubtype('" + sub[i] + "')\">" + t_db[sub[i]]['name'] + '</li>';
            }
            $('menu_p_sub_type').innerHTML = html;
            showPsubtypeSelect();
			if (isforce == 0) {
				selectPsubtype(0);
			} else {
             	selectPsubtype(sub[0]);
			}
        } else {
            $('td_p_sub_type').style.display = 'none';
            selectPsubtype(-1);
        }
    }
    closePtypeSelect();
    try{event.cancelBubble = true;}catch(e){}
}
selectPsubtype = function (v) {
    document.FORM.p_sub_type.value = typeof t_db[v] == 'undefined' ? 0 : v;
   	closePsubtypeSelect();
    try{event.cancelBubble = true;}catch(e){}
}
showPtype = function(v) {
    if (typeof t_db[v] != 'undefined') {
        if (t_db[v]['upid'] == '0') {
            selectPtype(v);
        } else {
            selectPtype(t_db[v]['upid']);
            selectPsubtype(v);
        }
    }
}
})();
</script>
<!--
EOT;
if ($action == 'modify' && $atcdb['type']) {print <<<EOT
-->
<script language="JavaScript">window.onReady(function(){	showPtype('$atcdb[type]');});</script>
<!--
EOT;
}}if(($action == "reply" || $action == "quote") && $tpcarray['special'] == 5){print <<<EOT
-->
							<select name="standpoint" style="height:26px;" class="fl mr5">
<!--
EOT;
if($debatestand != 2){print <<<EOT
-->
                    <option value="1" $debate_1>正方观点</option>

<!--
EOT;
}if($debatestand != 1){print <<<EOT
-->
                    <option value="2" $debate_2>反方观点</option>
<!--
EOT;
}print <<<EOT
-->
                    <option value="0" $debate_0>闲聊一下</option>
                </select>

<!--
EOT;
}if ($selectmodelhtml) {print<<<EOT
-->
				<div style="padding-right:5px;" class="fl">$selectmodelhtml</div>
<!--
EOT;
}print <<<EOT
-->
          		<div class="w_title_ip fl">
                    <input name="atc_title" id="atc_title" value="$atc_title" tabindex="1" title="请输入标题" onkeydown="checktitlelength()" />
<!--
EOT;
if ($db_threademotion) {print <<<EOT
-->
                    <i id="icon_button" onclick="show_icontab()" class="cp"><img align="absmiddle" src="$imgpath/post/emotion/$icon.gif" /></i>
					<div class="fl">
						<div id="icontab" onmouseover="if(icontab==1)icontab=2;" onmouseout="if(icontab==2)icontab=1;" style="display:none;">
							<div class="cc cp">
								<input type="hidden" id="atc_iconid" name="atc_iconid" value="$icon" />
								<img onmouseover="this.className='iconhover'" onmouseout="this.className=''" onclick="seticonid(0,'0.gif')" align="absmiddle" src="$imgpath/post/emotion/0.gif" />
<!--
EOT;
foreach ($icondb as $key => $value) {print <<<EOT
-->
								<img onmouseover="this.className='iconhover'" onmouseout="this.className=''" onclick="seticonid('$key','$value')" align="absmiddle" src="$imgpath/post/emotion/$value" />
<!--
EOT;
}print <<<EOT
-->
							</div>
						</div>
					</div>
<!--
EOT;
}print <<<EOT
-->
					<span id="wordtip"></span>
					<span class="w_input_text" style="display:none;" id="atc_title_warn"></span>
				</div>
            </div>
<!--
EOT;
if($db_sitemsg['post']['0'] && $action == 'new'){print<<<EOT
-->
           <span class="post_tips mb5">{$db_sitemsg['post'][array_rand($db_sitemsg['post'])]}</span>
<!--
EOT;
}if($db_sitemsg['reply']['0'] && $action == 'reply'){print<<<EOT
-->
           <span class="post_tips mb5">{$db_sitemsg['reply'][array_rand($db_sitemsg['reply'])]}</span>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($special) {print <<<EOT
-->
            <div class="mb10">
<!--
EOT;
require_once PrintEot('post_special');
print <<<EOT
-->
            </div>
<!--
EOT;
}if ($topichtml) {print <<<EOT
-->
            <div class="mb10">$topichtml
<script language="javascript">
function ifalipay(value) {
if (value == 1) {
    ajax.send('pw_ajax.php?action=pcifalipay','',function(){
        var rText = ajax.request.responseText.split('\t');
        if(rText[0] == 'fail') {
            showDialog('warning','您还没有支付宝帐号，请到管理中心的<a href="profile.php?action=modify&info_type=trade" target="_blank"><span style="color:red;">账号设置</span></a>添加');
        } else {
            return false;
        }
    });
} else {
    return false;
}
}
function pcdelimg(id,fieldid,pctype) {
ajax.send('pw_ajax.php?action=pcdelimg','id='+id+'&fieldid='+fieldid+'&pctype='+pctype+'&tid='+'$tid',function(){
    var rText = ajax.request.responseText;
    if (rText == 'success') {
        showDialog('success','删除成功!',2);
        getObj('img_'+fieldid).style.display = 'none';
    } else {
        showDialog('error','非法操作',2);
        return false;
    }
});
}
</script>
            </div>
<!--
EOT;
}print<<<EOT
-->
            <div class="cc mb10">
<!--
EOT;
$allowUseMagic = $db_windmagic && ($action=='new' || ($action=='modify' && $pid == 'tpc'));
require_once PrintEot('wysiwyg_editor');
if ($allowUseMagic) {print <<<EOT
-->
<style>
.lhcl_slideImage{width:50px;height:50px;cursor:pointer;border:1px solid #fff;}
.lhcl_selectBox{width:50px;height:50px;cursor:pointer;border:1px solid #36c;}
</style>
				<div id="menu_magicsmile" style="display:none"></div>
				<div class="fr">
					<div style="display: none;left:auto;margin-top:-492px;margin-left:-162px;" id="magicsmiliebox" class="B_menu">
						<div class="B_p10 w">
						<div class="b f14 tac">动漫表情</div>
						<div id="menu_magicshow" class="tac"></div>
						<div class="B_tac"><a onclick="previewMagic();return false;" href="javascript:;" class="B_mr10">预览</a><a onclick="setMagic(this.id);getObj('magicsmiliebox').style.display='none';return false;" href="javascript:;" id="btnc">取消</a></div>
						</div>
					</div>
				</div>
<script language="javascript">var mDef = { $mDef };</script>
<script type="text/javascript" src="js/magic.js"></script>
<!--
EOT;
}print <<<EOT
-->
            </div>
						<div class="cc mb10">
						<ul class="post_ulA fl">
<!--
EOT;
if($db_replysitemail){
$checkAtcNewrp = $atc_newrp ? $atc_newrp : (($db_replysitemail && getstatus($winddb['userstatus'], PW_USERSTATUS_REPLYSITEEMAIL)) ? 'checked' : '');
print <<<EOT
-->
							<li><label for="atc_newrp"><input type="checkbox" id="atc_newrp" name="atc_newrp" value="1" $checkAtcNewrp />&nbsp;回复短信通知</label></li>
<!--
EOT;
}if ($pwpost->isGM || $_G['htmlcode']) {print <<<EOT
-->
							<li><label for="atc_html"><input type="checkbox" name="atc_html" id="atc_html" value="1" $htmcheck onclick="editor.setHtmlMode(this)" />&nbsp;使用html代码</label></li>
<!--
EOT;
}print <<<EOT
-->
							<li><label for="atc_anonymous"><input type="checkbox" id="atc_anonymous" name="atc_anonymous" value="1" $ifanonymous />&nbsp;匿名帖</label></li>
							<li><label for="atc_hide"><input type="checkbox" id="atc_hide" name="atc_hide" value="1" $htmlpost />&nbsp;隐藏此帖(回复可见)</label></li>
						</ul>
						<a href="javascript:;" id="post_set_button" class="post_more" onclick="post_set();return false;">更多选项</a>
						</div>
			<div class="w_options cc" id="post_set_box" style="display:none;">
				<ul class="post_ulA fl">
					<li><label for="atc_usesign"><input type="checkbox" id="atc_usesign" name="atc_usesign" value="1" checked />&nbsp;使用签名</label></li>
					<li><label for="atc_autourl"><input type="checkbox" id="atc_autourl" name="atc_autourl" value="1" checked />&nbsp;自动分析url</label></li>
					<li><label for="atc_convert"><input type="checkbox" id="atc_convert" name="atc_convert" value="1" checked />&nbsp;WindCode转换</label></li>
<!--
EOT;
if ($db_replysendmail) {
$checkAtcEmail = $atc_email ? $atc_email : (($db_replysendmail && getstatus($winddb['userstatus'], PW_USERSTATUS_REPLYEMAIL)) ? 'checked' : '');
print <<<EOT
-->
					<li><label for="atc_email"><input type="checkbox" id="atc_email" name="atc_email" value="1" $checkAtcEmail/>&nbsp;回复电子邮件通知</label></li>
<!--
EOT;
}print <<<EOT
-->
				</ul>
				<ul class="post_ulB fl">
<!--
EOT;
if (($action == 'new' || $action == 'vote') && ($pwpost->isGM || pwRights($pwpost->isBM,'typeadmin'))) {print <<<EOT
-->
					<li>
						<em>精华：</em><label><input name="digest" type="radio" value="0" checked />&nbsp;无</label><label><input name="digest" type="radio" value="1" />&nbsp;1</label><label><input name="digest" type="radio" value="2" />&nbsp;2</label>
					</li>
<!--
EOT;
}if ($action == 'new' && ($pwpost->isGM || pwRights($pwpost->isBM,'topped') > 0)) {print <<<EOT
-->
					<li><em>置顶：</em><label><input name="topped" type="radio" value="0" checked />&nbsp;无</label><label><input name="topped" type="radio" value="1" />&nbsp;1</label><!--
EOT;
if ($pwpost->isGM || pwRights($pwpost->isBM,'topped') > 1) {print <<<EOT
--><label><input name="topped" type="radio" value="2" />&nbsp;2</label><!--
EOT;
}if ($pwpost->isGM || pwRights($pwpost->isBM,'topped') > 2) {print <<<EOT
--><label><input name="topped" type="radio" value="3" />&nbsp;3</label><!--
EOT;
}print <<<EOT
-->
					</li>
<!--
EOT;
}
print <<<EOT
-->
<!--
EOT;
if(($pwpost->isGM || pwRights($pwpost->isBM,'replayorder')) && (!$pid || $pid == 'tpc')){print <<<EOT
-->
					<li><em>回复显示顺序：</em><label><input type="radio" name="replayorder" value="0" $replayorder_default>&nbsp;默认</label><label><input type="radio" name="replayorder" value="1" $replayorder_asc>&nbsp;正序</label><label><input type="radio" name="replayorder" value="2" $replayorder_desc>&nbsp;倒序</label>
					</li>
<!--
EOT;
}print <<<EOT
-->
				</ul>
				<ul class="post_ulB fl">
					<li><input type="checkbox" name="atc_requiresell" id="atc_requiresell" value="1" $htmlsell />出售：<input name="atc_money" type="text" value="0" maxlength="6" size="4" class="input" />
						<select name="atc_credittype" class="mr5" id="attmode_2">$selltype</select>(不能大于:<span class="s2">{$db_sellset[price]}</span>)
						<div class="c"></div>
					</li>
					<li>
						<input type="checkbox" name="atc_requireenhide" id="atc_requireenhide" value="1" $htmlhide />加密：<input name="atc_rvrc" type="text" value="0" class="input" maxlength="6" size="4" />
						<select name="atc_enhidetype" id="attmode_1" class="mr5">$enhidetype</select>以上才能浏览
						<div class="c"></div>
					</li>
				</ul>
			</div>
			<script language="JavaScript">if (FetchCookie('post_set') == '1') post_set();</script>
						
<!--
EOT;
if($db_iftag && ($action=='new' || $action=='modify' && $pid=='tpc')){print <<<EOT
-->
            <script type="text/javascript" language="JavaScript" src="js/pw_tags.js"></script>
            <div class="cc mb10">
                <div><input id="atc_tags" class="input fl input_wb mr5 gray" name="atc_tags" value="$tags" tabindex="201" onfocus="tag.init();" /><span class="bt2 fl"><span><button type="button" onclick="tag.get()">提取标签</button></span></span><span style="margin:3px 0 0 10px;" class="fl"><span class="fl">标签之间空格隔开，限5个。&nbsp;</span><a class="wy_tips" href="javascript:;" onclick="return false;" style="padding-right:14px;">什么是标签<i style="width:200px;">标签是您给您的文章指定的关键字，设置适当的标签能便于他人快速的找到您的文章，最多可填写5个，每个3-15字节</i></a></span></div>
                <div class="c"></div>
                <fieldset id="tagmenu" style="border:1px solid $tdcolor;width:500px;padding:3px;margin:2px 0;display:none;"><legend>热门标签</legend><div style="height:80px;overflow-Y:auto;"></div></fieldset>
            </div>
<!--
EOT;
}if (($db_gdcheck & 4 && (!$db_postgd || $winddb['postnum'] < $db_postgd)) || (($db_ckquestion & 4) && (!$postq || $winddb['postnum'] < $postq) && $db_question)) {print <<<EOT
-->
            <div class="cc mb10">
                <div class="marginLeft">
<!--
EOT;
if(($db_gdcheck & 4) && (!$db_postgd || $winddb['postnum'] < $db_postgd)){
$gdSize = explode("\t",$db_gdsize);
print <<<EOT
-->
<span class="mr20"><input class="input" type="text" name="gdcode" size="8" tabindex="2" onfocus="showgd();" /><span style="cursor:pointer; margin-left:3px" onclick="this.previousSibling.focus();">点击刷新验证码</span>
<span id="ckcode" style="display:none">
<script type="text/javascript" src="js/pw_authcode.js"></script>
<script>
var flashWidth = "$gdSize[0]";
var flashHeight = "$gdSize[1]";
var gdtype = $db_gdtype;
showGdCode();
</script>
</span>
</span>
<!--
EOT;
}
empty($winddb['postnum']) && $winddb['postnum']=0;
if(($db_ckquestion & 4) && (!$postq || $winddb['postnum'] < $postq) && $db_question){
$qkey = array_rand($db_question);
if($db_imagequestion){
	$question = '<img id="ckquestion" src="ckquestion.php?q='.$qkey.'&t='.$timestamp.'" align="top">';
}else{
	$question = $qkey<0 ? getMachineQuestion_1() :  $db_question[$qkey];
}
$q_a = $question.($showq && $qkey>0?" 正确答案:".$db_answer[$qkey] : '');
print <<<EOT
-->
验证问题: &nbsp;{$q_a}&nbsp;&nbsp;<input class="input" type="text" name="qanswer" />
<input type="hidden" name="qkey" value="$qkey" />
<!--
EOT;
}print <<<EOT
-->
                </div>
            </div>
<!--
EOT;
}print <<<EOT
-->
						<div style="position:relative;zoom:1">
            	<div id="divload" style="position:absolute;bottom:0px;background-color:#fff;"></div>
            </div>
            <div style="margin-bottom:30px;" id="submit_bar">
							<span class="btn"><span><button type="submit" name="Submit"> 发 布 </button></span></span>
							<span class="bt"><span><button type="button" onclick="gopreview();"> 预 览 </button></span></span>
							<span class="bt"><span><button type="button" onclick="savedraft()"> 存为草稿 </button></span></span>
            </div>
      </td>
	</tr>
</table>
</div>
<!--
EOT;
if($theSpecialFlag){print<<<EOT
-->
	<script language="JavaScript">Form.validate("FORM");</script>
<!--
EOT;
}print <<<EOT
-->
<div id="menu_face" class="menu" style="display:none;"></div>
<div id="menu_generalface" class="menu" style="display:none;"></div>
<input type="hidden" value="2" name="step" />
<input type="hidden" value="$pid" name="pid" />
<input type="hidden" value="$action" name="action" />
<input type="hidden" value="$fid" name="fid" />
<input type="hidden" value="$tid" name="tid" />
<input type="hidden" value="$article" name="article" />
<input type="hidden" value="$special" name="special" />
<input type="hidden" value="cn0zz" name="_hexie" />
<script type="text/javascript">
<!--
EOT;
$tmpVerify = GetVerify($onlineip.$GLOBALS['winddb']['regdate'].$fid.$tid);print <<<EOT
-->
document.FORM._hexie.value='$tmpVerify';
</script>
<!--
EOT;
if($action == 'reply' || $action == 'modify' || $action == 'quote'){print <<<EOT
-->

<!--
EOT;
}else{print <<<EOT
-->
<script language="JavaScript">setTimeout("document.FORM.atc_title.focus()",50);</script>
<!--
EOT;
}if($special=='1' || $special=='2' || $special=='5'){ print <<<EOT
-->
<script language="JavaScript" src="js/date.js"></script>
<!--
EOT;
}print <<<EOT
-->
</form>
<!--
EOT;
if($previewForm){print <<<EOT
-->
	$previewForm
<!--
EOT;
}else{print <<<EOT
-->
<form name="preview" action="job.php?action=preview" method="post" target="preview_page">
	<input type="hidden" name="pcid" value="$pcid" />
	<input type="hidden" name="modelid" value="$modelid" />
<!--
EOT;
}print <<<EOT
-->
	<input type="hidden" name="atc_content" value="" />
	<input type="hidden" name="atc_title" value="" />
	<input type="hidden" name="pcinfo" value="" />
</form>
<script language="JavaScript">
var icontab=0;
function show_icontab() {
	if (icontab <= 0) {
		getObj('icontab').style.display = '';
		icontab = 1;
	} else {
		getObj('icontab').style.display = 'none';
		icontab = 0;
	}
}
function seticonid(iconid,iconurl) {
	getObj('atc_iconid').value=iconid;
	getObj('icontab').style.display='none';
	icontab = -1;
	getObj('icon_button').innerHTML = '<img align="absmiddle" src="$imgpath/post/emotion/'+iconurl+'" />';
}
function set_ptype(id,ptype) {
	getObj('td_ptype').innerHTML = ptype + '<img align="absmiddle" src="$imgpath/menu-down.gif" />';
	getObj('p_type').value = id;
	closep();
}
var cate = '$db_forcetype'; //是否强制分类，开启设为1，关闭设为0；
var cnt  = 0;

document.FORM.Submit.disabled = false;
function checktitlelength(){
	setTimeout(function(){
	var l = strlen($('atc_title').value);
	if(l<$db_titlemax&&l>$db_titlemax-20)
	{
		$('wordtip').innerHTML='剩余'+($db_titlemax-l)+'个字节';
		$('wordtip').style.backgroundColor='#fffeed';
		$('wordtip').style.display='inline';
	}
	else if(l==$db_titlemax)
	{
		$('wordtip').innerHTML='已经达到最大字数限制';
		$('wordtip').style.backgroundColor='#ffd9d9';
		$('wordtip').style.display='inline';
	}
	else if(l>=$db_titlemax)
	{
		$('wordtip').innerHTML='已经超过最大字数限制！';
		$('wordtip').style.backgroundColor='#ff9999';
		$('wordtip').style.display='inline';
	}
	else
		$('wordtip').style.display='none';
	},100);
}
function checkpost(obj) {
	var action = "{$action}";
	var pid = "{$pid}";
<!--
EOT;
$showGdCode = $showQAnswer = 0;
$isGM = CkInArray($windid,$manager);
if(!$isGM && ($db_gdcheck & 4) && (!$db_postgd || $winddb['postnum'] < $db_postgd)){
	$showGdCode = 1;
}

if(!$isGM && $q_a){
	$showQAnswer = 1;
}
print <<<EOT
-->
	var showGdCode = "{$showGdCode}";
	var showQAnswer = "{$showQAnswer}";
	if (action == 'modify' && pid != 'tpc'){
		action = 'reply';
	}
	if (obj.p_type != null && obj.p_type.value==0 && cate==1) {
		showDialog({
			type: "error",
			message: "请选择 <span class='s1'>主题分类</span> 。",
			onClose:function(){
				obj.atc_title.focus();
			}
		});
		return false;
	}
	if (obj.atc_title.value == "") {
		if (action != 'reply'){
			obj.atc_title.setAttribute("hasError", 1);
			showDialog({
				type: "error",
				message: "<span class='s1'>标题</span> 不能为空。",
				onClose: function(){
					obj.atc_title.focus();
				}
			});
			return false;
		}
	} else if (strlen(obj.atc_title.value) > $db_titlemax) {
		obj.atc_title.setAttribute("hasError", 1);
		showDialog({
			type: "error",
			message: "标题超过最大长度  <span class='s1'>$db_titlemax</span> 个字节",
			onClose: function(){
				obj.atc_title.focus();
			}
		});
		return false;
	} else if (showGdCode == '1' && obj.gdcode.value == ''){
		obj.gdcode.setAttribute("hasError", 1);
        showDialog({
            type: "error",
            message: "<span class='s1'>验证码</span> 不能为空",
            onClose: function(){
            	obj.gdcode.focus();
            }
        });
		return false;
	} else if (showQAnswer == '1' && obj.qanswer.value == ''){
		obj.qanswer.setAttribute("hasError", 1);
		showDialog({
			type: "error",
			message: "请输入正确的验证问题答案",
			onClose : function(){
				obj.qanswer.focus();
			}
		});
		return false;
	}
	if (strlen(obj.atc_content.value) < $postMinLength) {
		obj.atc_content.setAttribute("hasError", 1);
		showDialog({
			type: "error",
			message: "内容少于  <span class=\'s1\'>$postMinLength</span> 个字节。",
			onClose : function(){
				editor.focusEditor();
			}
		});
		return false;
	} else if (strlen(obj.atc_content.value) > $db_postmax) {
		obj.atc_content.setAttribute("hasError", 1);
		showDialog({
			type: "error",
			message: "内容大于  <span class=\'s1\'>$db_postmax</span> 个字节",
			onClose: function(){
				editor.focusEditor();
			}
		});
		return false;
	}
	try{obj.atc_title.removeAttribute("hasError");
	obj.atc_content.removeAttribute("hasError");}catch(e){}

	ajaxSubmit(obj);
	return false;
}
function ajaxSubmit(obj){
	document.FORM.Submit.disabled = true;
	getObj('divload').innerHTML = showLoading();
	ajax.send("post.php?fid=$fid", obj, function(){
		if (undefined == ajax.request.responseText) {
			showDialog({
				type: 'error',
				message: "<span class=\'s1\'>附件</span> 太大或网络原因，请求超时，请稍后再试!"
			});
			document.FORM.Submit.disabled = false;
			getObj('divload').innerHTML = '';
			return false;
		}
		var rText = ajax.request.responseText.split('\t');
		if (rText[0] == 'success') {
			window.onbeforeunload = function(){};
			top.window.location =  rText[1];
		} else if (rText[0] == 'continue') {
			showDialog({type:'confirm',message:rText[1],okText:'继续',onOk:function(){
				obj.iscontinue.value = 1;
				ajaxSubmit(obj);
			}});
		} else {
			//刷新验证码及验证问题
			try{getObj('ckquestion').src = getObj('ckquestion').src.replace(/t=\d+/,'t='+new Date().getTime()); }catch(e){}
			try{getObj('changeGdCode').src = getObj('changeGdCode').src.replace(/nowtime=\d+/,'nowtime='+new Date().getTime());}catch(e){}
			showDialog('error', rText[0]);
		}
		cnt = 0;
		document.FORM.Submit.disabled = false;
		getObj('divload').innerHTML = '';
		return false;
	});
}
function gopreview() {
	editor.save();
	//editor.setMode();
	document.preview.atc_content.value=document.FORM.atc_content.value;
	document.preview.atc_title.value=document.FORM.atc_title.value;
	var elements = document.FORM.elements;
	var pcinfo = '';
	for (var i = 0,len = elements.length; i < len; i++) {
		if (elements[i].type == 'radio' || elements[i].type == 'checkbox') {
			if (elements[i].checked == true) {
				pcinfo += elements[i].name + '(|)' + elements[i].value + '(|)' + elements[i].id + '{|}';
			}
		} else {
			pcinfo += elements[i].name + '(|)' + elements[i].value + '(|)' + elements[i].id + '{|}';
		}
	}
	document.preview.pcinfo.value=pcinfo;
	document.preview.submit();
}

function changeShowTip(obj) {
	if (getObj('show_tip_img').src.indexOf('showNormal') >= 0) {
		setTimeout("changeShowTipImg('$imgpath/showAll.gif')", 200);
		obj.previousSibling.nextSibling.innerHTML='显示全部设置';
		showItems(0);
	} else {
		setTimeout("changeShowTipImg('$imgpath/showNormal.gif')", 200);
		obj.previousSibling.nextSibling.innerHTML='只显示常用';
		showItems(1);
	}
}
function changeShowTipImg(path) {
	getObj('show_tip_img').src = path;
}
</script>
<script language="JavaScript" src="js/post.js"></script>
<script language="JavaScript">
var dataStorage = {
	save : function() {
		if (PwStorage.save('msg', editor.getUBB())) {
			PwStorage.save('title', document.FORM.atc_title.value, 1);
			SetCookie('ds', 1);
			return true;
		}
		return false;
	},
	load : function() {
		document.FORM.atc_title.value = PwStorage.load('title') || '';
		setEditorContent(PwStorage.load('msg'));
		SetCookie('ds', 0);
	}
}
if (FetchCookie('ds') == 1) {
	try{dataStorage.load();}catch(e){}
}
</script>
<script type="text/javascript">
window.onbeforeunload = function(){
    var atc_title = document.FORM['atc_title'].value;
    var atc_content = document.FORM['atc_content'].value;
/*    atc_title = atc_title.trim();
    atc_content = atc_content.trim();*/
    //if (atc_title != "" || (atc_content != "" && atc_content != "<br>")) {
	//if(is_ie && (event.srcElement.id == 'newdraft') ) return false;
		return "您正在编辑的帖子没有保存，离开会导致内容丢失，是否确定离开？";
//    }
}
window.scroll(0, 190);
</script>
<div id="previewmagic" style="position:absolute;z-index:999999;display:none;"></div>
<div class="c"></div>
</div>
<!--
EOT;
if($action=="reply" || $action=="quote"){print <<<EOT
-->
<div class="t">
<div class="tr2 f_two" style="line-height:25px;height:25px;padding:0 10px;">主题回顾</div>
$review_reply
</div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
?>-->